package org.codefinger.dao.callback;

import java.sql.ResultSet;
import java.util.Date;

import org.codefinger.dao.impl.ResultSetCallback;

public class DateQueryCallback implements ResultSetCallback<Date> {

	public static final DateQueryCallback	INSTANCE	= new DateQueryCallback();

	private DateQueryCallback() {

	}

	@Override
	public Date getResult(ResultSet resultSet, String[] aliases)
			throws Throwable {
		if (resultSet.next()) {
			return new Date(resultSet.getTimestamp(1).getTime());
		}
		return null;
	}

}
